﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SlideshowGenerator
{
    public partial class Frm_LanguageSelection : Form
    {
        public Frm_LanguageSelection()
        {
            InitializeComponent();
        }

        private bool _languageSelected = false;

        private void Frm_LanguageSelection_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (!_languageSelected)
            {
                Application.Exit();
            }
        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
            switch (languageSelection.Text)
            {
                case Configuration.Languages.English:
                    Configuration.Language = Configuration.Languages.English;
                    break;
                case Configuration.Languages.Turkish:
                    Configuration.Language = Configuration.Languages.Turkish;
                    break;
                default:
                    Configuration.Language = Configuration.Languages.English;
                    break;
            }
            Configuration.SaveConfiguration();
            _languageSelected = true;
            this.Dispose();
        }
    }
}
